package exceptions;

public class Except {
	private static int method(int a, int b) {
		int z = 0;
		try {
			z = a / b;
		} catch (NullPointerException ae) {
			System.err.println("Caught a Null");
		}
		return z;
	}

	public static void main(String[] a) {
		int x = 5;
		try {
			for (int y = -2; y < 3; y++) {
				int z = 0;
				z = method(x, y);
				int b = z - 1;
				String str = null;

				System.out.println("x is " + x + ", y is " + y + ", and z is "
						+ z);
				System.out.println("b is " + b + str.replace("a", "b"));
			}
		} catch (ArithmeticException ae) {
			System.err.println("Caught the exception for real!!");
		} catch (NullPointerException ne){
			System.err.println("Caught the null");			
		} 
	}
}
